//用方法返回一个数组
public class DemoArrayReturn {
    public static void main(String[] args) {
        int result[]=calculate(12,23,34);
        System.out.println("sum="+result[0]);
        System.out.println("avg="+result[1]);
    }

    public static int[] calculate(int a, int b, int c) {
        int sum=a+b+c;
        int avg=sum/3;
        int arr[]={sum,avg};
        return arr;
    }
}
